package com.JobWebGem.system.service.impl;

import com.JobWebGem.system.mapper.JobMapper;
import com.JobWebGem.system.model.dto.job.JobQueryRequest;
import com.JobWebGem.system.model.entity.Job;
import com.JobWebGem.system.service.JobService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
* @author renli
* @description 针对表【job(存储岗位信息)】的数据库操作Service实现
* @createDate 2024-12-02 21:18:40
*/
@Service
public class JobServiceImpl extends ServiceImpl<JobMapper, Job>
    implements JobService {

    @Override
    public Page<Job> listPage(Page<Job> paramPage, JobQueryRequest jobQueryRequest) {
        QueryWrapper<Job> queryWrapper = new QueryWrapper<>();
        if (jobQueryRequest.getJob() != null && jobQueryRequest.getJob().length() > 0) {
            queryWrapper.like("job", jobQueryRequest.getJob());
        }
        if (jobQueryRequest.getEducation() != null && jobQueryRequest.getEducation().length() > 0) {
            queryWrapper.like("education", jobQueryRequest.getEducation());
        }
        if (jobQueryRequest.getExperience() != null && jobQueryRequest.getExperience().length() > 0) {
            queryWrapper.like("experience", jobQueryRequest.getExperience());
        }
        if (jobQueryRequest.getSalary() != null && jobQueryRequest.getSalary().length() > 0) {
            queryWrapper.like("salary", jobQueryRequest.getSalary());
        }
        if (jobQueryRequest.getArea() != null && jobQueryRequest.getArea().length() > 0) {
            queryWrapper.like("area", jobQueryRequest.getArea());
        }
        return this.page(paramPage, queryWrapper);
    }
}




